Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

globule

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

globule

An easy-to-use wildcard globbing library.

  • 1.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.2M
increased by9.27%
Maintainers
3
Weekly downloads
 
Created

What is globule?

The globule npm package is a utility for file system operations that involve matching file paths using glob patterns. It provides a simple and flexible way to find, read, and manipulate files based on patterns.

What are globule's main functionalities?

File Matching

This feature allows you to find files that match a specific glob pattern. In this example, it finds all JavaScript files in the 'src' directory and its subdirectories.

const globule = require('globule');
const matches = globule.find('src/**/*.js');
console.log(matches);

File Copying

This feature allows you to copy files that match a specific glob pattern to a new location. In this example, it copies all JavaScript files from the 'src' directory to the 'dist' directory.

const globule = require('globule');
globule.copy('src/**/*.js', 'dist');

File Deletion

This feature allows you to delete files that match a specific glob pattern. In this example, it deletes all JavaScript files in the 'dist' directory and its subdirectories.

const globule = require('globule');
globule.del('dist/**/*.js');

File Reading

This feature allows you to read the contents of files that match a specific glob pattern. In this example, it reads and logs the contents of all JavaScript files in the 'src' directory and its subdirectories.

const globule = require('globule');
const files = globule.find('src/**/*.js');
files.forEach(file => {
  const content = globule.read(file);
  console.log(content);
});

Other packages similar to globule

Keywords

FAQs

Package last updated on 21 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc